package com.yykj.hospital.server.converter;

import com.yykj.hospital.client.dto.banci.HospitalBanCiDTO;
import com.yykj.hospital.server.model.entity.banci.HospitalBanCi;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class HospitalBanCiDTOConverter {

    public static HospitalBanCiDTO convert(HospitalBanCi hospitalBanCi){
        HospitalBanCiDTO dto = new HospitalBanCiDTO();
        BeanUtils.copyProperties(hospitalBanCi,dto);
        return dto;
    }

    public static List<HospitalBanCiDTO> convert(List<HospitalBanCi> list){
        return list.stream().map(HospitalBanCiDTOConverter::convert).collect(Collectors.toList());
    }

}
